<!-- Copyright (c) 2019-2020 十三 all rights reserved. -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<header th:replace="admin/header::header-fragment">
</header>
<style>
    .ui-jqgrid tr.jqgrow td {
        white-space: normal !important;
        height: auto;
        vertical-align: text-top;
        padding-top: 2px;
    }
</style>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
    <!-- 引入页面头header-fragment -->
    <div th:replace="admin/header::header-nav"></div>
    <!-- 引入工具栏sidebar-fragment -->
    <div th:replace="admin/sidebar::sidebar-fragment(${path},${session.adminIdentity})"></div>
    <!-- Content Wrapper. Contains 图标content -->
    <div class="content-wrapper">
        <!-- Content Header (图标header) -->
        <div class="content-header">
            <div class="container-fluid">
            </div><!-- /.container-fluid -->
        </div>
        <!-- Main content -->
        <div class="content">
            <div class="container-fluid">
                <div class="card card-primary card-outline">
                    <div class="card-header">
                        <h3 class="card-title">采购管理</h3>
                    </div> <!-- /.card-body -->
                    <div class="card-body">
                        <div class="grid-btn">
                            <button class="btn btn-info" onclick="purchaseAdd()"><i
                                    class="fa fa-plus"></i>&nbsp;新增
                            </button>
                            <!--<button class="btn btn-info" onclick="purchaseEdit()"><i-->
                                    <!--class="fa fa-pencil-square-o"></i>&nbsp;修改-->
                            <!--</button>-->
                            <!--<button class="btn btn-danger" onclick="deletePurchase()"><i-->
                                    <!--class="fa fa-trash-o"></i>&nbsp;删除-->
                            <!--</button>-->
                        </div>
                        <table id="jqGrid" class="table table-bordered">
                        </table>
                        <div id="jqGridPager"></div>
                    </div><!-- /.card-body -->
                </div><!-- /.container-fluid -->
            </div>
        </div>

        <div class="content">
            <!-- 模态框（Modal） -->
            <div class="modal fade" id="purchaseModal" tabindex="-1" role="dialog" aria-labelledby="purchaseModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                    aria-hidden="true">&times;</span></button>
                            <h6 class="modal-title" id="purchaseModalLabel">Modal</h6>
                        </div>
                        <div class="modal-body">
                            <form id="purchaseForm">
                                <div class="form-group">
                                    <div class="alert alert-danger" id="edit-error-msg" style="display: none;">
                                        错误信息展示栏。
                                    </div>
                                </div>
                                <input type="hidden" class="form-control" id="purchaseId" name="purchaseId">
                                <!--<input type="hidden" class="form-control" id="staffId" name="staffId" th:value="${session.loginUserId}">-->
                                <div class="form-group">
                                <label for="supplierName" class="control-label">供货商名称:</label>
                                <select class="form-control col-sm-3" id="supplierName"
                                        data-placeholder="请选择供货商名称...">
                                    <th:block th:unless="${null == supplierInfoList}">
                                        <th:block th:each="c : ${supplierInfoList}">
                                            <option th:value="${c.supplierId}" th:text="${c.supplierName}">
                                                <!--th:selected="${null !=firstLevelCategoryId and firstLevelCategoryId==c.categoryId} ?true:false">-->

                                            </option>
                                        </th:block>
                                    </th:block>
                                </select>
                                </div>
                                <div class="form-group">
                                    <label for="goodsName" class="control-label">商品名称:</label>
                                    <select class="form-control col-sm-3" id="goodsName"
                                            data-placeholder="请选择商品名称...">
                                        <th:block th:unless="${null == goodsList}">
                                            <th:block th:each="c : ${goodsList}">
                                                <option th:value="${c.goodsId}" th:text="${c.goodsName}">
                                                    <!--th:selected="${null !=firstLevelCategoryId and firstLevelCategoryId==c.categoryId} ?true:false">-->

                                                </option>
                                            </th:block>
                                        </th:block>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="purchaseQuantity" class="control-label">采购数量:</label>
                                    <input type="number" class="form-control" id="purchaseQuantity" name="purchaseQuantity"
                                           placeholder="请输入采购数量" required="true">
                                </div>

                                <div class="form-group">
                                    <label for="importPrice" class="control-label">进货价:</label>
                                    <input type="number" class="form-control" id="importPrice" name="importPrice"
                                           placeholder="请输入进货价" required="true">
                                </div>
                                <!--<div class="form-group">-->
                                    <!--<label for="purchaseAddress" class="control-label">地址:</label>-->
                                    <!--<input type="text" class="form-control" id="purchaseAddress" name="purchaseAddress"-->
                                           <!--placeholder="请输入供货商地址" required="true">-->
                                <!--</div>-->
                                <!--<div class="form-group">-->
                                    <!--<label for="purchasePhone" class="control-label">联系电话:</label>-->
                                    <!--<input type="text" class="form-control" id="purchasePhone" name="purchasePhone"-->
                                           <!--placeholder="请输入供货商联系电话" required="true">-->
                                <!--</div>-->
                                <!--<div class="form-group">-->
                                    <!--<label for="contactName" class="control-label">联系人姓名:</label>-->
                                    <!--<input type="text" class="form-control" id="contactName" name="contactName"-->
                                           <!--placeholder="请输入联系人姓名" required="true">-->
                                <!--</div>-->
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <button type="button" class="btn btn-primary" id="saveButton">确认</button>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /.modal -->
        </div>
    </div>
    <!-- /.content-wrapper -->
    <!-- 引入页脚footer-fragment -->
    <div th:replace="admin/footer::footer-fragment"></div>
</div>
<!-- jQuery -->
<script th:src="@{/admin/plugins/jquery/jquery.min.js}"></script>
<!-- Bootstrap 4 -->
<script th:src="@{/admin/plugins/bootstrap/js/bootstrap.bundle.min.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/admin/dist/js/adminlte.min.js}"></script>
<!-- jqgrid -->
<script th:src="@{/admin/plugins/jqgrid-5.5.2/grid.locale-cn.js}"></script>
<script th:src="@{/admin/plugins/jqgrid-5.5.2/jquery.jqGrid.min.js}"></script>
<!-- sweetalert -->
<script th:src="@{/admin/plugins/sweetalert/sweetalert.min.js}"></script>
<script th:src="@{/admin/dist/js/public.js}"></script>
<script th:src="@{/admin/dist/js/newbee_mall_purchase.js}"></script>
</body>
</html>
